<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/FoodSageTemplate.xhtml">
 
    <ui:define name="logout">
        <p:commandLink id="logoutLink" actionListener="#{touristLogoutManagedBean.doLogout}" value="#{bundle['login.logout.label']}" ajax="false" immediate="true" />
    </ui:define>
 
    <ui:define name="main_menu">
        <p:menubar model="#{itineraryViewTripItineraryManagedBean.touristMainMenuModel}"/>
    </ui:define>
 
    <ui:define name="nav_menu">
        <p:menu model="#{itineraryViewTripItineraryManagedBean.touristNavMenuModel}"/>
    </ui:define>
    
    <ui:define name="content">
        <f:view beforePhase="#{itineraryViewTripItineraryManagedBean.initView}" >
            <p:panel id="tripItineraryDetail" header="#{bundle['tripItinerary.header.panel']}"  >
                <p:messages id="statusMessages" />

                <h:panelGrid columns="4" cellpadding="5">
                    <h:outputLabel id="itineraryNameLabel" value="#{bundle['tripItinerary.itineraryName.label']}" style="font-weight: bold"/>
                    <h:outputText id="itineraryName" value="#{itineraryViewTripItineraryManagedBean.itineraryName}" />
                    <p:message for="itineraryName" />
                    <h:outputText value="&nbsp;" />

                    <h:outputLabel id="itineraryArrivalDateTimeLabel" value="#{bundle['tripItinerary.arrivalDateTime.label']}" style="font-weight: bold"/>
                    <h:outputText id="arrivalDate" value="#{itineraryViewTripItineraryManagedBean.arrivalDate}" />
                    <h:outputText id="arrivalTime" value="#{itineraryViewTripItineraryManagedBean.arrivalTime}" />
                    <h:outputText id="arrivalTimeZone" value="#{itineraryViewTripItineraryManagedBean.arrivalTimeZone}" />

                    <h:outputLabel id="itineraryDepartureDateTimeLabel" value ="#{bundle['tripItinerary.departureDateTime.label']}" style="font-weight: bold"/>
                    <h:outputText id="departureDate" value="#{itineraryViewTripItineraryManagedBean.departureDate}" />
                    <h:outputText id="departureTime" value="#{itineraryViewTripItineraryManagedBean.departureTime}" />
                    <h:outputText id="departureTimeZone" value="#{itineraryViewTripItineraryManagedBean.departureTimeZone}" />


                    <h:outputLabel id="itineraryAccomodationPostalCodeLabel" value ="#{bundle['tripItinerary.accomodationPostalCode.label']}" style="font-weight: bold"/>
                    <h:outputText id="accomodationPostalCode" value="#{itineraryViewTripItineraryManagedBean.accomodationPostalCode}" />
                    <p:message for="accomodationPostalCode"/>
                    <h:outputText value="&nbsp;" />

                    <h:outputLabel id="itineraryNoOfAdultsLabel" value ="#{bundle['tripItinerary.noOfAdults.label']}" style="font-weight: bold"/>
                    <h:outputText id="noOfAdults" value="#{itineraryViewTripItineraryManagedBean.noOfAdults}" />
                    <p:message for="noOfAdults"/>
                    <h:outputText value="&nbsp;" />

                    <h:outputLabel id="itineraryNoOfChildrenLabel" value ="#{bundle['tripItinerary.noOfChildren.label']}" style="font-weight: bold"/>
                    <h:outputText id="noOfChildren" value="#{itineraryViewTripItineraryManagedBean.noOfChildren}" />
                    <p:message for="noOfChildren"/>
                    <h:outputText value="&nbsp;" />
                </h:panelGrid>

                <p:dataTable var="dailyItinerary" value="#{itineraryViewTripItineraryManagedBean.dailyItinerariesList}"  
                             emptyMessage="itinerary.norecordsfound.label" 
                             paginator="true" rows="10"  
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                             rowsPerPageTemplate="5,10,15"> 

                    <f:facet name="header">  
                        <h:outputText value="#{bundle['itinerary.myDailyItineraries.header']}"/>
                    </f:facet>  

                    <p:column sortBy="#{dailyItinerary.dayNo}"  >  
                        <f:facet name="header">  
                            <h:outputText value="#{bundle['dailyItinerary.dayNo.label']}" />  
                        </f:facet>  
                        <h:outputText value="#{dailyItinerary.dayNo}" />  
                    </p:column>  

                    <p:column sortBy="#{dailyItinerary.localizedDayDate}">  
                        <f:facet name="header">  
                            <h:outputText value="#{bundle['dailyItinerary.dayDate.label']}" />  
                        </f:facet>  
                        <h:outputText value="#{dailyItinerary.localizedDayDate}" />  
                    </p:column>  

                    <p:column>
                        <p:commandButton value="#{bundle['dailyItinerary.view.button']}" update="statusMessages" actionListener="#{itineraryViewTripItineraryManagedBean.viewDailyItineraryView(dailyItinerary)}" image="ui-icon ui-icon-pencil" />
                        <p:commandButton value="#{bundle['dailyItinerary.delete.button']}" update="statusMessages" actionListener="#{itineraryViewTripItineraryManagedBean.viewDailyItineraryDelete(dailyItinerary)}" image="ui-icon ui-icon-trash" />
                    </p:column>

                </p:dataTable>

                <br/>
                <h:commandLink id="tripItineraryEditButton" value="#{bundle['tripItinerary.edit.button']}" action="#{pageRedirectorBean.goItineraryEditTripItineraryPage}" />
            </p:panel>
        </f:view>
    </ui:define>  

</ui:composition>

